package controller.user;

import cn.smbms.tools.Constants;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @program: SMBMS-two
 * @description:
 * @author: Mr.peng
 * @create: 2020-05-24 15:19
 **/
@Controller
public class Loginout {
    @RequestMapping("jsp/logout.do")
    public String doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        System.out.println("123");
        //清除session
        request.getSession().removeAttribute(Constants.USER_SESSION);
        //response.sendRedirect(request.getContextPath()+"/login.jsp");
        return "redirect:/login.jsp";
    }
}
